package 写入;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;
import java.util.Random;

/**
 * @author Administrator
 * @ClassName WriteTest
 * @TIME 星期三 2020/12/30
 */
public class WriteTest {
    public static void main(String[] args) throws IOException {
        Random r = new Random();
        int r1 = r.nextInt();
        int r2 = r.nextInt();
        int r3 = r.nextInt();
        int r4 = r.nextInt();
        int[] arr = {r1,r2,r3,r4};
        FileWriter fileWriter = new FileWriter("D:\\文本\\Demo.txt");

        for (int i = 0; i < 10; i++) {
            fileWriter.write(Arrays.toString(arr));
            fileWriter.write("\n");
            fileWriter.flush();
        }
        fileWriter.close();
    }
}
